#ifndef OVERLAPPINGMATCHER_H_
#define OVERLAPPINGMATCHER_H_

#ifndef NULL
#define NULL 0
#endif

#include "map/RoadSegment.h"

#include "util/Matcher.h"
#include <string>
/*
 * Matcher que utiliza el metodo getId() para comparar un elemento con un id.
 */
class OverlappingMatcher: public Matcher<RoadSegment> {
public:
	/* Constructor. Recibe el rango que se va a usar de overlapping */
	OverlappingMatcher(int minHeight, int maxHeight) {
		this->minHeight = minHeight;
		this->maxHeight = maxHeight;
	}

	/* Destructor. */
	virtual ~OverlappingMatcher() {}

	/*
	 * Metodo para comparar. Devuelve true en caso que el id del elemento
	 * a comparar sea igual al id seteado anteriormente.
	 */
	virtual bool matches(RoadSegment* dataToCompare) {
		return dataToCompare->overlaps(minHeight, maxHeight);
	}

private:
	int minHeight, maxHeight;
};

#endif /* OVERLAPPINGMATCHER_H_ */
